package com.suxin.config;

import org.springframework.format.support.FormattingConversionService;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

/**
 * @author Tang
 * @classname RootConfig
 * @description [  ]
 * @date 2021/4/8 10:06
 */
//@Configuration
public class RootConfig {

    @Resource
    FormattingConversionService mvcConversionService;

    @PostConstruct
    public void init() {
        mvcConversionService.addConverterFactory(new MyConverterFactory());
    }

//    @Bean
//    ConversionService conversionService() {
//        ConversionServiceFactoryBean factoryBean = new ConversionServiceFactoryBean();
//        factoryBean.setConverters(Collections.singleton(new MyConverterFactory()));
//        factoryBean.afterPropertiesSet();
//        return factoryBean.getObject();
//    }

}